﻿using System;

namespace Average
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] ave = new int[10];
            for (int i = 0; i <= ave.Length-1 ; i++)
            {
                Console.WriteLine("请输入第{0}个数：", i+1 );
                ave[i] = Int32.Parse(Console.ReadLine());
            }
            Console.WriteLine(Ave(ave));
        }
        /// <summary>
        /// 求平均值的函数（十个参数）
        /// </summary>
        /// <returns></returns>
        static double Ave(int[] b)
        {
            double sumD = 0;
            for (int i = 0; i <= b .Length-1; i++)
            {
                //do
                //{
                //    if (Int32 .TryParse (Console .ReadLine(),out numB[i] ))
                //    {

                //    }while (true);
                //} 
                //Console.WriteLine("请输入第{0}个数：", i + 1);
                //numB[i] = Int32.Parse(Console.ReadLine());
                sumD += b [i];
            }
            Console.WriteLine($"这十个数的平均值是:{sumD / 10}");
            return sumD;
        }
    }
}
